<?php /* Smarty version Smarty-3.1.14, created on 2017-08-17 16:32:41
         compiled from "E:\phpStudy\WWW\zyshop\admin\templates\quyu_list.html" */ ?>
<?php /*%%SmartyHeaderCode:252245994f29f07ec55-22846888%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'fffe084e73bbfec33114fa06a42b75ab9af43c11' => 
    array (
      0 => 'E:\\phpStudy\\WWW\\zyshop\\admin\\templates\\quyu_list.html',
      1 => 1502957727,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '252245994f29f07ec55-22846888',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.14',
  'unifunc' => 'content_5994f29f0ba841_80329589',
  'variables' => 
  array (
    'URL' => 0,
    'res' => 0,
    'list' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5994f29f0ba841_80329589')) {function content_5994f29f0ba841_80329589($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_date_format')) include 'E:\\phpStudy\\WWW\\zyshop\\includes\\libs\\plugins\\modifier.date_format.php';
?><?php echo $_smarty_tpl->getSubTemplate ("header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

<script type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['URL']->value;?>
resource/laydate/laydate.js"></script>
<style>
table{text-align: center;}
th{text-align:center; font-weight: bolder;}
th a{ color:#000000;}
.firtd {	width: 100px;	padding-right: 10px;	text-align: right;}
input{width: 90px;}
textarea {	width: 350px;	height: 100px;}
#jin{
color:#f00;
}
#jin1{
color:#0D93BF;
}
</style>
<body>
<div class="fixed-bar">
  <div class="item-title">
    <h3>区域列表</h3>
      <div style="background:rgba(251,112,45,1);width:125px;height:40px;float:right;text-align:center;border-radius:5px;">
        <a href="quyu.php?act=edit">
          <h5 style="padding:10px;color:#fff;">添加区域</h5>
        </a>
      </div>
  </div> 
</div>
<div class="fixed_bottom">
  <form method="post" action="" id="aspnetForm" name="form1">
    <table align="center;" class="table tb-type2">
      <thead>
        <tr>
          <th width="50"><a>编号</a></th>
          <th width="25%"><a>区域名称</a></th>
          <th><a>添加时间</a></th>
          <th><a>是否开启</a></th>
          <th><a>操作</a></th>
        </tr>
      </thead>
      <tbody id="sortable">
        <?php  $_smarty_tpl->tpl_vars['list'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['list']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['res']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['list']->key => $_smarty_tpl->tpl_vars['list']->value){
$_smarty_tpl->tpl_vars['list']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['list']->key;
?>
            <tr>
              <td><?php echo $_smarty_tpl->tpl_vars['list']->value['r_id'];?>
</td>
              <td><?php echo $_smarty_tpl->tpl_vars['list']->value['r_name'];?>
</td>
              <td><span><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['list']->value['r_time'],'%Y-%m-%d %H:%M:%I');?>
</span></td>
              <td>
                <?php if ($_smarty_tpl->tpl_vars['list']->value['r_zt']==1){?>
                  <a href="javascript:;" id="jin" onclick="jy(this,<?php echo $_smarty_tpl->tpl_vars['list']->value['r_id'];?>
)">禁用</a>
                <?php }else{ ?>
                  <a href="javascript:;" id="jin1" onclick="jy(this,<?php echo $_smarty_tpl->tpl_vars['list']->value['r_id'];?>
)">开启</a>
                <?php }?>

              </td>
              <td>
                <a href="quyu.php?act=edit&r_id=<?php echo $_smarty_tpl->tpl_vars['list']->value['r_id'];?>
">编辑</a> 
                <a href="#" onclick="del(this,<?php echo $_smarty_tpl->tpl_vars['list']->value['r_id'];?>
)">删除</a> 
              </td>
            </tr>
        <?php } ?>
      </tbody>
    </table>
   <div class="page"></div>
  </form>
</div>
</body>
<script>
  function jy(obj,s_id){
  if($(obj).html()=='禁用'){
    var vals=1;
  }else{
    var vals=2;
  }
  $.post("quyu.php",{act:'disable',id:s_id,val:vals},function(data){
   if(data==1){
      layer.msg("操作成功！");
      if(vals==1){$(obj).html("开启");$(obj).css("color","#0D93BF");}else{$(obj).html("禁用");$(obj).css("color","#f00")}
    }else if(data==2){
      layer.msg("操作失败！");
    }
  })
}
function del(obj,r_id){
  $.post("quyu.php",{act:'del1',r_id:r_id},function(data){
      if(data=='1'){
        layer.msg("操作成功！",{},function(){
			$(obj).parents("tr").remove();
		});
      }else{
        layer.alert(data);
      }
  })
}
</script>
</html><?php }} ?>